package com.example.demo.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.Entity.Directory;
import com.example.demo.Entity.Directoryitem;
import com.example.demo.Entity.Note;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DirectoryMapper extends BaseMapper<Directory> {
    @Select("select directory_id,directory_name from directory ,directoryitem where directory.directory_group =directoryitem.directory_id and user_id =#{userId}")
    public Directoryitem findDirectoryitemByUserId(int userId);


    @Delete("delete  from directory where note_id =#{noteId}")
    public void deleteByNoteId(int noteId);

    @Delete("delete  from directory where directory_group =#{directoryGroup}")
    public void deleteByGroup(int directoryGroup);


}
